package cloud.daodao.storm.common.security.model.aes;

import cloud.daodao.storm.common.serialize.Serializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @author DaoDao
 */
@Schema(title = "AesCipherParam", description = "AES 加解密")
@Data
public class AesCipherParam implements Serializer {

    @Schema(title = "key", description = "AES 密钥", example = "0000000000000000")
    @NotEmpty
    @Size(min = 16, max = 16)
    private String key;

    @Schema(title = "iv", description = "AES 向量", example = "0000000000000000")
    @NotEmpty
    @Size(min = 16, max = 16)
    private String iv;

    @Schema(title = "source", description = "源", example = "1")
    @NotEmpty
    @Size(min = 1, max = 102400)
    private String source;

    @Schema(title = "encode", description = "编码", example = "HEX")
    @NotEmpty
    @Size(min = 1, max = 16)
    @Pattern(regexp = "^(HEX|BASE64)$")
    private String encode;

}
